import os
from openai import OpenAI
# 设置 openai相关的参数
# 设置你的 OpenAI API 密钥
client = OpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
    base_url=os.getenv("OPENAI_BASE_URL")
)

# 调用 Chat Completion API
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {"role": "system", "content": "你是一个友好的助手。"},
        {"role": "user", "content": "你好"}
    ]
)

# 打印响应
print(response.choices[0].message.content)